{% extends 'base.html' %} {% load static %} {% block title %}Analytics Dashboard - AI Code Reviewer{% endblock %} {% block content %}

{% if is_staff %}System Analytics Dashboard{% else %}Personal Analytics Dashboard{% endif %}

Monitor AI review frequency, average scores, and performance latency stats.

Export CSV
{% if is_staff %}
Total Users
{{ total_users }}
{% endif %}
Total Reviews
{{ total_reviews }}
Favorite Language
{{ most_used_lang }}
Avg Latency
{{ latency_avg }}ms
Success Rate
{{ success_rate }}%

Review Averages

Security Score {{ avg_security }}/10
Performance Score {{ avg_performance }}/10
Readability Score {{ avg_readability }}/10
Overall Average Score {{ avg_overall }}/10

Review Trends

Languages

{% if lang_counts %} {% else %}
No review statistics yet.
{% endif %}
{% if is_staff %}

Manage Profiles

{% for u in user_list %} {% empty %} {% endfor %}
Username Status Actions
{{ u.username|slice:":1"|upper }}
{{ u.username }} {{ u.email }}
{% if u.profile.is_blocked %} Blocked {% else %} Active {% endif %}
{% csrf_token %} {% if u.profile.is_blocked %} {% else %} {% endif %}
No other system users.

API Request History Audit

{% for log in recent_logs %} {% empty %} {% endfor %}
User Lang Latency Status Details
{{ log.user.username|default:"Anonymous" }} {{ log.language|upper }} {{ log.latency_ms }}ms {% if log.status == 'SUCCESS' %} 200 OK {% else %} FAIL {% endif %} {{ log.error_message|default:"Success" }}
No audit logs recorded yet.
{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}